Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels inside node markers #128

Merged
merged 8 commits into from
May 15, 2023
Merged

Labels inside node markers #128

merged 8 commits into from
May 15, 2023

Conversation

greimel
Copy link
Collaborator

@greimel greimel commented Apr 19, 2023

Closes #57

Test and docs are missing, will follow soon.

@greimel
Copy link
Collaborator Author

greimel commented Apr 20, 2023

I've re-run CI on the last commit. One refimage needs updating.

This PR unintentionally breaks 7 more refimages. For debugging I added the last commit. It fixes those regressions, but breaks the feature of that PR.

I don't understand why.

@hexaeder
Copy link
Collaborator

hexaeder commented Apr 21, 2023

The reftests are just normal package tests, so if you run ] test locally you should be able to see what changed in those plots for debug purposes. Reftest img 12 is broken on master, maybe this should be fixed in a separate PR so all open stuff can rebause on it.

@greimel
Copy link
Collaborator Author

greimel commented Apr 21, 2023

I think I discovered the problem.

update_arrow_shift(graph[], gp, paths, tpx)

update_arrow_shift uses node_size and node_marker. So the code needs to be rearranged a bit.

greimel and others added 2 commits April 21, 2023 14:31
Co-authored-by: Hans Würfel <git@wuerfel.io>
- `ilabels=nothing`: `Vector` with label for each node
- `ilabels_color=labels_theme.color`
- `ilabels_fontsize=labels_theme.fontsize`
- `ilabels_attr=(;)`: List of kw arguments which gets passed to the `text` command
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should note that ilabels_attr cannot be set interactively, and users should manipulate the underlying text plot directly!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by that? The idea behind this was basically that users can forward own observables into the underlying plot function without explicitly exposing each and every attribute of the scatter/line/text plots in the graphplots recipe

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g = complete_graph(3)
visible = Observable(false)
graphplot(g; node_attr=(;visible))
visible[] = true #interactive update

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be the same as nlabels_attr, elabels_attr, node_attr, edge_attr, arrow_attr, right?

Probably this issue should be discussed separately?

Copy link
Collaborator Author

@greimel greimel Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asinghvi17 do you mean that _, _, p = graphplot(...), p[:ilabel_attr] = ... doesn't work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_, _, p = graphplot(...), p[:ilabel_attr] = ... doesn't work

I did mean that - the usage which @hexaeder suggested should work fine. This wouldn't work because a reference to the attributes at the time of plot creation is splatted, and changing the attributes afterwards wouldn't have an effect.

I guess we should probably clarify that somewhere? It's not a blocker for the PR by any means, just something I noticed.

@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2023

Codecov Report

Patch coverage: 95.83% and project coverage change: -0.60 ⚠️

Comparison is base (297ab68) 80.35% compared to head (463cadf) 79.76%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
- Coverage   80.35%   79.76%   -0.60%     
==========================================
  Files           4        5       +1     
  Lines         667      687      +20     
==========================================
+ Hits          536      548      +12     
- Misses        131      139       +8     
Impacted Files Coverage Δ
src/recipes.jl 93.60% <95.83%> (-2.81%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@greimel greimel changed the title Labels inside nodes Labels inside node markers Apr 21, 2023
@greimel
Copy link
Collaborator Author

greimel commented Apr 21, 2023

@hexaeder this is ready for your review.

I wasn't sure if that feature should be shown in the feature walk-through instead of (or in addition to) the reftests.

@greimel greimel requested a review from hexaeder May 1, 2023 19:05
Copy link
Collaborator

@hexaeder hexaeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long delay. I think the changes to the node plot keywords should be documented, also it might be nice to add an example of this (doesn’t need to be fancy) to the feature walkthrough docpage? Otherwise it might be less discoverable…

@hexaeder hexaeder merged commit b3f8f9d into master May 15, 2023
@hexaeder hexaeder deleted the nodenames branch May 15, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Text boxes instead of text labels
4 participants